package com.zmwx.club.gateway.enums;

import lombok.Getter;

@Getter
public enum ResultCode {
    SUCCESS(200, "成功"),
    FAIL(500, "失败");
    private int code;
    private String desc;//状态中文

    ResultCode(int code, String desc) {
        this.code = code;
        this.desc = desc;

    }

    public static ResultCode getByCode(int code) {
        for (ResultCode resultCode : ResultCode.values()) {
            if (resultCode.getCode() == code) {
                return resultCode;
            }
    }
        return null;
    }
}
